# Contributor: Mogens Jensen <mogens-jensen@protonmail.com>
# Maintainer: Mogens Jensen <mogens-jensen@protonmail.com>
pkgname=uefitool
pkgver=0.28.0
pkgrel=1
pkgdesc="UEFI firmware image viewer and editor"
url="https://github.com/LongSoft/UEFITool"
arch="all"
license="BSD-2-Clause"
makedepends="qt5-qtbase-dev"
options="!check" # No test suite
source="$pkgname-$pkgver.tar.gz::https://github.com/LongSoft/UEFITool/archive/$pkgver.tar.gz"
builddir="$srcdir/UEFITool-$pkgver"

build() {
	qmake-qt5 -o Makefile uefitool.pro
	make
	qmake-qt5 -o UEFIPatch/Makefile UEFIPatch/uefipatch.pro
	make -C UEFIPatch
	qmake-qt5 -o UEFIReplace/Makefile UEFIReplace/uefireplace.pro
	make -C UEFIReplace
}

package() {
	install -d "$pkgdir"/usr/bin
	install -m 0755 UEFITool "$pkgdir"/usr/bin/UEFITool
	install -m 0755 UEFIPatch/UEFIPatch "$pkgdir"/usr/bin/UEFIPatch
	install -m 0755 UEFIReplace/UEFIReplace "$pkgdir"/usr/bin/UEFIReplace
}

sha512sums="5db9b2004dcc8482dd03713fd67b86cabb93455723e1cafad1ec9b877b0b73354e7f692dd3f5ff7ecc5992d6abd5ca2fb5b0cd2d103f4e722320164539d29483  uefitool-0.28.0.tar.gz"
